<?php
/**
 * 导航分类验证器
 * @author maniac
 */
namespace app\common\validate;

class NavCategory extends Base
{
    // 验证规则
    protected $rule = [
        'name' => 'require|unique',
        'id'   => 'containSub'
    ];
    
    // 错误信息
    protected $message = [
        'name.require' => '请填写导航分类名称',
        'id'           => '请先删除分类下的导航',
    ];
    
    // 验证场景
    protected $scene = [
        'add' => ['name'],
        'del' => ['id'],
    ];
}
